<extend name="Layout::photo"/>
<block name="content">
    <div class="layout-content">

        <div class="page-title">公告管理</div>

        <div class="content-top">
            <ul class="top-nav">
                <li class="active"><span>添加信息</span></li>
            </ul>
            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
        <!--content-main start-->
        <div class="container-fluid content-main">
            <div class="row">
                <div class="col-md-12">
                    <div id="tsk" class="ui-tips bg-info" style="display:none">
                        <span class="icon glyphicon glyphicon-info-sign"></span> <span
                            id="ts">提示信息提示信息提示信息提示信息提示信息提示信息。</span>
                    </div>
                    <form class=" form-horizontal"  action="{:U('Photo/doUpdate')}" method="post" enctype="multipart/form-data">
                        <input type="hidden" value="{$list['id']}" name="id">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">图片名</label>
                            <div class="col-sm-5">
                                <input type="text"  name="name"  value="{$list['name']}" class="form-control "/>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-5">
                                <input type="text"  name="remark" class="form-control" value="{$list['remark']}" />
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分类名</label>
                            <div class="col-sm-5">
                                <select class="form-control js-cate" name="photo_cate">
                                    <foreach name="cates" item="cate">
                                        <option data-cate="{$cate.id}" value="{$cate.id}">{$cate.name}</option>
                                    </foreach>
                                </select>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">图片</label>
                            <div class="col-sm-2">
                                <img src="__PUBLIC__/upload/{$list['pic']}"  width="120px" height="120px">
                                <input type="file" name="pic">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group" >
                            <label class="col-sm-2 control-label">链接</label>
                            <div class="col-sm-5">
                                <input type="text" name="url" value="{$list['url']}"  class="form-control" />
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否显示</label>
                            <div class="col-sm-2">
                                是<input type="radio" name="status"  data-status="10" value="10" >
                                否<input type="radio" name="status" data-status="30"  value="30">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-8">
                                <button  style="margin-left: 90px;width: 150px" type="submit"
                                         class="btn btn-default">保存
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--content-main end-->
    </div>
    <script>
        $('option[data-cate={$list["photo_cate"]}]').attr("selected", true);
        $('input[data-status={$list["status"]}]').attr("checked", "checked");

    </script>
</block>
